<?php declare(strict_types=1);
/**
 * @author      xianganyall <xianganyall@gmail.com>
 * @copyright   2023-2025 owner
 **/

namespace Srv\Libs\ConfModel;

final class PhpConf extends ConfAbstract
{
    public const PREFIX                         = 'PHP.';               // 配置前缀[必定点结尾]
    protected int $timeLimit                    = 0;                    // 运行时长[秒][0-不限制]
    protected string $versionMin                = '7.0.0';              // 最低版本
    protected string $timeZone                  = 'UTC';                // 默认时区[UTC,Asia/Shanghai]
    protected string $errorLevel                = 'ALL';                // 错误等级[NONE,NOTICE,WARNING,ERROR,ALL]
    protected string $extList                   = '';                   // 必须模块
    protected bool $chRoot                      = true;                 // 是否启用chRoot

    /**
     * @param array $confData
     */
    public function __construct(array $confData)
    {
        $this->init($confData);
    }

    /**
     * @return int
     */
    public function getTimeLimit(): int
    {
        return $this->timeLimit;
    }

    /**
     * @return string
     */
    public function getVersionMin(): string
    {
        return $this->versionMin;
    }

    /**
     * @return string
     */
    public function getTimeZone(): string
    {
        return $this->timeZone;
    }

    /**
     * @return string
     */
    public function getErrorLevel(): string
    {
        return $this->errorLevel;
    }

    /**
     * @return string
     */
    public function getExtList(): string
    {
        return $this->extList;
    }

    /**
     * @return bool
     */
    public function isChRoot(): bool
    {
        return $this->chRoot;
    }
}